package com.github.rxyor.common.support.enums;

import com.github.rxyor.common.core.enums.KeyValue;
import lombok.Getter;
import lombok.ToString;

/**
 *<p>
 *
 *</p>
 *
 * @author liuyang
 * @date 2019/10/21 周一 16:25:00
 * @since 1.0.0
 */
@SuppressWarnings("all")
@ToString
public enum MysqlErrorCodeEnum implements KeyValue<Integer> {
    DEFAULT(0, "数据库操作失败"),
    DATA_TOO_LONG(1406, "数据库字段长度超出限制"),
    DUPLICATE_ENTRY(1062, "数据库唯一约束数据冲突"),
    ;

    @Getter
    private Integer code;

    @Getter
    private String desc;

    MysqlErrorCodeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }
}
